
const koa = require("koa")
const app = new koa()
const server = require("koa-static")
const path = require("path")
const PORT = 9999

const router = require('koa-router');
let myRouter = new router();


myRouter.post('/b',function(ctx,next){

    console.log('\n\nctx-->',ctx.req.headers);
    
    ctx.body = {a:"hoholoving"}

    next()

})

app

    .use(myRouter.routes())
    .use(myRouter.allowedMethods())
    .listen(PORT, () => {
        console.log("开启成功", `http://localhost:${PORT}/`)
    })